(function (doc, win) {
    var docEl = doc.documentElement || doc.body;
    var resizeEvt = 'orientationchange' in win ? 'orientationchange' : 'resize';

    function recalc() {
        var designWidth = 750;
        var clientWidth = docEl.clientWidth;
        if (!clientWidth || clientWidth > designWidth) {
            docEl.style.fontSize = '50px';
        } else {
            docEl.style.fontSize = (100 * clientWidth / designWidth) + 'px';
        }
    }

    if (!doc.addEventListener) return;
    win.addEventListener(resizeEvt, recalc, false);
    doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);